package com.neusoft.neuiotms.dcvm.task.cmdbSyn.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcvm.task.cmdbSyn.dto.RackUnitUsageDTO;
import com.neusoft.neuiotms.dcvm.task.cmdbSyn.model.RackUnitUsage;

@Component
public class RackUnitUsageConverter extends AbstractConverter<RackUnitUsage, RackUnitUsageDTO> {

    @Override
    public RackUnitUsage toModel(final RackUnitUsageDTO dto) {
        final RackUnitUsage model = new RackUnitUsage();
        BeanUtils.copyProperties(dto, model);
        return model;
    }

    @Override
    public RackUnitUsageDTO toDTO(final RackUnitUsage model, final boolean forListView) {
        final RackUnitUsageDTO dto = new RackUnitUsageDTO();
        BeanUtils.copyProperties(model, dto);
        return dto;
    }
}
